<template>
  <div class="g-bd f-cb">

    <div class="g-mn4">
      <div class="g-mn4c">
        <div class="g-wrap6">
          <div class="m-info f-cb">
            <div class="cover u-cover u-cover-dj">
              <!--<img :src="list.coverImgUrl" class="j-img" :data-src="list.coverImgUrl">-->
              <img :src=coverImgUrl class="j-img">
              <span class="msk"></span>
            </div>
            <div class="cnt">
              <div class="cntc">
                <div class="hd f-cb">
                  <!--<i class="f-fl u-icn u-icn-13"></i>-->
                  <div class="tit">
                    <h2 class="f-ff2 f-brk">{{userName}}</h2>
                  </div>
                  <el-button class="edit-profile">编辑个人资料</el-button>
                </div>

                <div>
                  <div class="n-myinfo">
                    <ul class="dny">
                      <li class="fst"><a href="/user/event?id=352725071">
                        <strong id="event_count">0</strong><span class="event">动态</span>
                      </a></li>
                      <li><a href="/user/follows?id=352725071">
                        <strong id="follow_count">2</strong><span class="event">关注</span>
                      </a></li>
                      <li class="lst"><a href="/user/fans?id=352725071">
                        <strong id="fan_count">0</strong><span class="event">粉丝</span>
                      </a></li>
                    </ul>
                  </div>
                </div>

                <p class="intr f-brk"><b>所在地区：</b>
                  {{city}}
                </p>
                <p class="intr f-brk"><b>社交络：</b>

                </p>
              </div>
            </div>

          </div>
          <song-list  title="听歌排行" :song-list-id="2313779410"></song-list>
        </div>

      </div>
      <song-sheet-list title="我创建的歌单"></song-sheet-list>

      <song-sheet-list title="我收藏的歌单"></song-sheet-list>
    </div>
  </div>
</template>

<script>

  import {playlistDetail} from  './../service/getDate';
  import playlist from './playlist'
  import SongSheetList from "../components/songSheetList";
  import SongList from "../components/songList";

  export default {
    name: 'userHome',
    data () {
      return {
        list: [],
        city: "广东省-广州市",
        userName: "小明",
        coverImgUrl: "http://p3.music.126.net/Y33TAK_8JxdfKE8hXqJOJA==/19050138463028113.jpg?param=200y200"
      }
    },
    methods: {
      play(item){
        this.$store.commit('addQueue',item);
        this.$store.dispatch('getMusicUrl')
      },
      allin(){
        this.$store.commit('addAll',this.list.tracks);
        this.$store.dispatch('getMusicUrl')
      }
    },
    mounted(){
      playlistDetail(this).get({
        detail: 'detail',
        id: this.$route.query.id
      }).then(res => {
        console.log(res);
        this.list = res.body.playlist;
        this.list.tracks.forEach(function (value, key) {
          value.singer = "";
          value.ar.forEach(function (val, k) {
            value.singer += val.name + '/'
          });
          value.singer = value.singer.substr(0, value.singer.length-1);
        })
      });

    },
    components: {
      SongList,
      SongSheetList,
      playlistDetail,
      playlist
    }
  }
</script>

<style>
  .u-icn, .u-title-1 .out .icon {
    background: url(../image/icon.png) no-repeat 0 9999px;
  }

  .g-bd, .g-bd1, .g-bd2, .g-bd3, .g-bd4, .g-bd5, .g-bd6, .g-bd7 {
    width: 980px;
    min-height: 700px;
    _height: 700px;
    margin: 0 auto;
    background-color: #fff;
    border: 1px solid #d3d3d3;
    border-width: 0 1px;
  }

  .g-bd4 {
    background: url(../image/wrap4.png) repeat-y center 0;
  }

  .g-mn4 {
    float: left;
    width: 100%;
    /*margin-right: -270px;*/
  }

  .g-mn4c {
    /*margin-right: 271px;*/
  }

  .g-wrap6 {
    padding: 47px 30px 40px 39px;
  }

  .m-info .cover {
    float: left;
    position: relative;
    display: inline;
    margin: 0 -220px 0 0;
  }

  .u-cover-dj {
    width: 200px;
    height: 200px;
  }

  .u-cover {
    position: relative;
    display: block;
  }

  .u-cover img {
    display: block;
    width: 100%;
    height: 100%;
  }

  img, .txt {
    border: 0;
  }

  .u-cover .msk {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .u-cover .bottom, .u-cover .msk, .n-musicsd .lst .avatar .msk {
    background: url(../image/coverall.png) no-repeat;
    _background: url(../image/coverall.png) no-repeat 0 9999px;
  }

  .u-cover-dj .msk {
    width: 208px;
    height: 208px;
    background-position: 0 -1285px;
    top: -4px;
    left: -4px;
  }

  .m-info .cnt {
    float: right;
    width: 100%;
  }

  .m-info .cntc {
    margin-left: 230px;
  }

  .m-info .hd {
    position: relative;
    margin: 0 0 12px;
    line-height: 24px;
  }

  .f-fl {
    float: left;
  }

  em, i {
    font-style: normal;
    text-align: left;
    font-size: inherit;
  }

  .m-info .tit {
    /*margin-left: 64px;*/
    position: relative;
  }

  .m-info .hd h2 {
    line-height: 24px;
    font-size: 20px;
    font-weight: normal;
  }

  .f-brk {
    word-wrap: break-word;
    white-space: normal;
  }

  .f-ff2 {
    font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
  }

  .f-cb:after {
    clear: both;
    content: '.';
    display: block;
    height: 0;
    visibility: hidden;
  }

  .m-info .user {
    margin: 0 0 20px;
    line-height: 35px;
  }

  .m-info .user .face {
    margin-right: 10px;
  }

  a, a *, .f-hand, .f-hand * {
    cursor: pointer;
  }

  a {
    text-decoration: none;
    color: #333;
  }

  .m-info .user .face, .m-info .user .face img {
    float: left;
    width: 35px;
    height: 35px;
  }

  .m-info .user .name {
    float: left;
  }

  .s-fc7, a.s-fc7:hover {
    color: #0c73c2;
  }

  a:hover {
    text-decoration: underline;
    color: #333;
  }

  .m-info .user .u-icn {
    float: left;
    margin: 9px 0 0 3px;
  }

  .u-icn-84 {
    width: 12px;
    height: 13px;
    background-position: -65px -840px;
  }

  .m-info .user .time {
    margin-left: 15px;
  }

  .s-fc4, a.s-fc4:hover {
    color: #999;
  }

  .m-info .btns {
    margin-bottom: 25px;
    margin-right: -10px;
  }

  .u-btni-addply {
    float: left;
  }

  .u-btn2, .u-btn2 i, .u-btn2 .icn, .u-btni, .u-btni i, .u-tag, .u-tag i, .u-btni-addply .ply {
    background: url(../image/button2.png) no-repeat 0 9999px;
  }

  .u-btni-addply i {
    padding: 0 7px 0 8px;
  }

  .u-btn2-2 i {
    color: #fff;
    background-position: 0 -387px;
  }

  .u-btn2 i {
    padding: 0 15px 0 20px;
    pointer-events: none;
  }

  .u-btni-addply i {
    padding: 0 7px 0 8px;
  }

  .u-btn2, .u-btn2 i {
    display: inline-block;
    height: 31px;
    line-height: 31px;
    overflow: hidden;
    vertical-align: top;
    text-align: center;
    cursor: pointer;
  }

  .u-btni-addply .ply {
    float: left;
    width: 20px;
    height: 18px;
    margin: 6px 2px 2px 0;
    background-position: 0 -1622px;
    overflow: hidden;
  }


  .u-btni-fav i {
    background-position: 0 -977px;
  }

  .u-btni-share i, .u-btni-fav i, .u-btni-cmmt i, .u-btni-dl i, .u-btni-unfav i {
    padding-right: 2px !important;
    padding-left: 28px !important;
  }

  .u-btni i {
    padding: 0 7px 0 36px;
  }

  .u-btni, .u-btni i {
    float: left;
    height: 31px;
    line-height: 30px;
    min-width: 23px;
    cursor: pointer;
  }

  .m-info .btns2 .u-btni, .m-info .btns .u-btni {
    margin-right: 6px;
    font-family: simsun, \5b8b\4f53;
  }

  .m-info .btns .u-btni-add {
    margin-right: 5px !important;
  }

  .u-btni-share i {
    background-position: 0 -1225px;
  }

  .u-btni-dl i {
    background-position: 0 -2761px;
  }

  .u-btni-cmmt i {
    background-position: 0 -1465px;
  }

  .m-info .tags {
    margin: 25px 0 5px;
    line-height: 22px;
  }

  .m-info .tags b {
    float: left;
  }

  .m-info b {
    font-weight: normal;
    color: #666;
  }

  .m-info .tags .u-tag {
    float: left;
    margin: 0px 10px 3px 0;
  }

  .u-tag i {
    position: relative;
    zoom: 1;
    padding: 0 3px 0 13px;
    background-position: 0 0;
  }

  .u-tag, .u-tag i {
    float: left;
    height: 22px;
    line-height: 22px;
  }

  .m-info .intr {
    margin-top: 4px;
    line-height: 18px;
    color: #666;
  }

  .f-brk {
    word-wrap: break-word;
    white-space: normal;
  }

  .m-info .intr b {
    display: inline-block;
  }

  .m-info b {
    font-weight: normal;
    color: #666;
  }

  /*歌曲列表*/

  h1, h2, h3, h4, h5, h6 {
    font-size: 100%;
  }

  .u-title h3 {
    float: left;
    font-size: 24px;
    font-weight: normal;
  }

  .u-title-1 h3 {
    font-size: 20px;
    line-height: 28px;
  }

  .f-ff2 {
    font-family: "Microsoft Yahei", Arial, Helvetica, sans-serif;
  }


  strong, b {
    font-weight: bold;
  }

  table {
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
  }

  thead {
    display: table-header-group;
    vertical-align: middle;
    border-color: inherit;
  }

  tr {
    display: table-row;
    vertical-align: inherit;
    border-color: inherit;
  }

  .m-table th, .m-table th .wp, .m-table td, .m-table .ply, .m-table .mv, .m-table .icn, .m-info .edit {
    background: url(../image/table.png) no-repeat 0 9999px;
  }

  .m-table th {
    vertical-align: top;
    text-align: left;
    font-weight: normal;
    color: #666;
  }

  .m-table th {
    height: 38px;
    background-color: #f7f7f7;
    background-position: 0 0;
    background-repeat: repeat-x;
  }

  .m-table th .wp {
    height: 18px;
    line-height: 18px;
    padding: 8px 10px;
    background-position: 0 -56px;
  }

  .m-table th.first .wp {
    background: none;
  }

  .m-table td {
    padding: 6px 10px;
    line-height: 18px;
    text-align: left;
  }

  .m-table .hd {
    height: 18px;
  }



  .m-table b {
    font-weight: normal;
  }

  .m-table tr:nth-child(odd) td {
    background-color: #f7f7f7;
  }

  user agent stylesheet
  :focus {
    outline: -webkit-focus-ring-color auto 5px;
  }

  .m-table .text a {
    white-space: nowrap;
  }

  .n-myinfo {
    height: 165px;
    /*padding-top: 20px;*/
    padding-bottom: 20px;
  }

  .n-myinfo .dny li.fst {
    padding-left: 0;
  }
  .n-myinfo .dny li a {
    display: block;
    color: #666;
  }
  .n-myinfo .dny strong {
    display: block;
    font-size: 25px;
    font-weight: normal;
  }
  .n-myinfo .dny li a * {
    cursor: pointer;
  }
  .n-myinfo .dny span {
    margin-left: 2px;
  }
  .n-myinfo .dny li a * {
    cursor: pointer;
  }
  .n-myinfo .dny li.lst {
    padding-right: 0;
    border-right: none;
  }
  .n-myinfo .dny li.fst {
    padding-left: 0;
  }
  .n-myinfo {
    height: 50px;
    /*padding-top: 20px;*/
  }
  .n-myinfo .head img {
    display: block;
    width: 80px;
    height: 80px;
  }
  .n-myinfo .info p {
    width: 100%;
    margin-top: 5px;
  }
  .n-myinfo .info .btnwrap .sign i {
    width: 60px;
  }
  .n-myinfo .dny li {
    float: left;
    height: 40px;
    padding: 0 18px;
    border-right: 1px solid #e4e4e4;
  }
  .m-info .event {
    font-size: 15px;
  }

  .edit-profile {
    margin-top: -30px;
    float: right;
  }
</style>
